package cn.woblog.android.common.skin.demo;

import cn.woblog.android.common.skin.core.ThemeManager;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;

public class MainActivity extends BaseActivity {

	private Button bt_main;
	private RelativeLayout rl_root;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ThemeManager.setContext(this);
		setContentView(R.layout.activity_main);
	}

	@Override
	protected void initViews() {
		bt_main = (Button) findViewById(R.id.bt_main);
		rl_root = (RelativeLayout) findViewById(R.id.rl_root);
		super.initViews();
	}

	@Override
	protected void initStyle() {
		bt_main.setTextColor(ThemeManager.getColor(R.color.main_btn1));
		bt_main.setHeight(ThemeManager.getDimen(R.dimen.main_btn_height));
		bt_main.setWidth(ThemeManager.getDimen(R.dimen.main_btn_witdh));
		rl_root.setBackgroundDrawable(ThemeManager.getDrawable(R.drawable.main_backgroun));
		super.initStyle();
	}

	public void toSettingActivity(View view) {
		startActivity(new Intent(this, SettingActivity.class));
	}

	@Override
	protected void onResume() {
		super.onResume();
		ThemeManager.setRefreshUI();
	}
}
